package com.jay;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration;
import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;


@SpringBootApplication
        (
                exclude = {
                        DataSourceAutoConfiguration.class,
                        JmsAutoConfiguration.class,
                        ActiveMQAutoConfiguration.class,
                        EmbeddedServletContainerAutoConfiguration.class,
                        JpaRepositoriesAutoConfiguration.class,
                        JndiConnectionFactoryAutoConfiguration.class,
                        JndiDataSourceAutoConfiguration.class,
                        RedisAutoConfiguration.class,
                        RedisRepositoriesAutoConfiguration.class,
                        WebClientAutoConfiguration.class,
                        JtaAutoConfiguration.class,
                        DataSourceTransactionManagerAutoConfiguration.class,
                        TransactionAutoConfiguration.class,
                        HibernateJpaAutoConfiguration.class,
            }
                , scanBasePackages = {
                    "com.jay"
                }
        )
public class WebApplication extends SpringBootServletInitializer {
//    public static void main(String[] args) {
//        SpringApplication.run(WebApplication.class, args);
//    }
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
    // 注意这里要指向原先用main方法执行的Application启动类
    return builder.sources(WebApplication.class);
}
}